XCSP3 (competition) support #179
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR track the implementation of XCSP3 support. The goal is to support enough of the format to compete in the XCSP3 challenge.
General Tasks
fzn-huub
tohuub
, where the crate will be renamed fromfzn-huub
tohuub-cli
.Model
/Solver
extraction methods fromFlatZinc
andXcsp3Instance
behindflatzinc
andxcsp3
feature flags inhuub
.Output
andGoal
objects that could directly be output from thefrom_X
extraction methods.tracing
variable registration methods, or will we have to specialize the code for each?xcsp3-serde
Tasksmeta
constraintsgroup
Constraint support (as quoted from the competition call)>
extension
This constraint is described in Section 4.1.1.2 in [BLAP21a]. Competition restrictions:
accepted. However, do note that starred (or short) tables (i.e., tables with tuples containing ’*’) are accepted, as in 2019.
Note that unary, binary and n-ary extensional constraints are accepted.
regular
This constraint is described in Section 4.1.2.1 in [BLAP21a]. Competition restrictions:
mdd
This constraint is described in Section 4.1.2.3 in [BLAP21a]. Competition restrictions:
allDifferent
This constraint is described in Section 4.1.3.1 in [BLAP21a]. Competition restrictions:
In addition to the basic form of
allDifferent
, the advanced formallDifferent-matrix
described in Section 7.2.1 in [BLAP21a] is accepted.
Also, handling view extensions is authorized for the basic form of
allDifferent
. It means that instead of a list of variables inside the element , it is possible to have a list of integer expressions (trees). This is shown at the end of Section 4.1.3.1 in [BLAP21a]. Competition restriction:allDifferent
, the element contains either only variablesor only integer expressions (trees). It means that it is not possible to mix both forms.
allEqual
This constraint is described in Section 4.1.3.2 in [BLAP21a]. Compared to 2019, handling
view extensions is authorized for
allEqual
. It means that instead of a list of variables inside the element , it is possible to have a list of integer expressions (trees). There is no competition restriction for this constraint.ordered
This constraint is described in Section 4.1.3.4 in [BLAP21a]. Competition restrictions:
As in 2019, note that it is now possible to deal with an element .
sum
This constraint is described in Section 4.1.4.1 in [BLAP21a]. Competition restrictions:
Also, handling view extensions is authorized for sum. It means here that instead of a list of variables inside the element , it is possible to have a list of integer expressions (trees).
This is shown at the end of Section 4.1.4.1 in [BLAP21a]. Competition restriction:
count
This constraint is described in Section 4.1.4.2 in [BLAP21a]. Competition restrictions:
{lt,le,gt,ge,eq,ne}) and the (right) operand must be a value or a variable, or the operator must necessarily be in and the (right) operand must be an integer interval; See
Section 1.5 in [BLAP21a].
Compared to 2019, handling view extensions is authorized for count. It means here that instead of a list of variables inside the element , it is possible to have a list of integer expressions (trees).
nValues
This constraint is described in Section 4.1.4.3 in [BLAP21a]. Competition restrictions:
Not that it is possible to deal with the special case where the condition is composed of the operator gt and the (right) operand is the value 1, which corresponds to the global constraint notAllEqual. Compared to 2019, handling view extensions is authorized for nValues.
It means here that instead of a list of variables inside the element , it is possible to have a list of integer expressions (trees).
cardinality
This constraint is described in Section 4.1.4.4 in [BLAP21a]. Competition restrictions:
maximum
This constraint is described in Section 4.1.5.1 in [BLAP21a]. Competition restrictions:
minimum
This constraint is described in Section 4.1.5.2 in [BLAP21a]. Competition restrictions:
element
This constraint is described in Section 4.1.5.3 in [BLAP21a]. Competition restrictions:
As in 2019, it is possible to have a list of values (instead of variables) inside . This is presented in Section 4.1.5.3 in [BLAP21a].
Compared to 2019, the advanced form element-matrix described in Section 7.2.3 in [BLAP21a] is accepted.
channel
This constraint is described in Section 4.1.5.4 in [BLAP21a]. Competition restrictions:
As in 2019, note that for the form of channel involving two lists, it is possible that these two lists have different sizes. This is discussed at the top of Page 79 in Section 4.1.5.4 in [BLAP21a].
noOverlap
This constraint is described in Section 4.1.6.2 in [BLAP21a]. Competition restrictions:
cumulative
This constraint is described in Section 4.1.6.3 in [BLAP21a]. Competition restrictions:
instantiation
This constraint is described in Section 4.1.8.2 in [BLAP21a]. There is no competition restriction for this constraint.
circuit
This constraint is described in Section 4.1.7.1 in [BLAP21a]. Competition restrictions:
slide
This meta-constraint is described in Section 8.1 in [BLAP21a]. Competition restrictions:
precedence
This constraint is described in Section 4.1.3.5 in [BLAP22]. Competition restrictions:
covered
will not be used (and so, never present in instances used for the 2023 competition)knapsack
This constraint is described in Section 4.1.6.5 in [BLAP22]. Competition restrictions:
This constraint can be very easily decomposed.
binPacking
This constraint is described in Section 4.1.6.4 in [BLAP22]. Competition restrictions:
4.1.6.4)
This constraint can be easily decomposed.